[SOLARIS] Xen daemons are managed separately, so we need a way to start
authorAlastair Tse <atse@xensource.com>
Thu, 19 Oct 2006 10:36:49 +0000 (11:36 +0100)
committerAlastair Tse <atse@xensource.com>
Thu, 19 Oct 2006 10:36:49 +0000 (11:36 +0100)
just xend, and we need to disable xend's self-restarter.

Merged with Xen API Tree.

Signed-off-by: John Levon <john.levon@sun.com>
tools/python/xen/xend/server/SrvDaemon.py

index 65f042d1b51e8b9c039c29e9940bebaaa7dc4234..0455811aac9f4a8b9c9e1840342b2c5ba661ef1b 100644 (file)
@@ -17,6 +17,7 @@ import traceback
 import xen.lowlevel.xc
 
 from xen.xend.XendLogging import log
+from xen.xend import osdep
 
 import relocate
 import SrvServer
@@ -168,8 +169,14 @@ class Daemon:
             # ready to receive requests.  All subsequent restarts we don't
             # want this behaviour, or the pipe will eventually fill up, so
             # we just pass None into run in subsequent cases (by clearing w
-            # in the parent of the first fork).
+            # in the parent of the first fork).  On some operating systems,
+            # restart is managed externally, so we won't fork, and just exit.
             while True:
+
+                if not osdep.xend_autorestart:
+                    self.run(os.fdopen(w, 'w'))
+                    break
+
                 pid = self.fork_pid()
                 if pid:
                     if w is not None: